In mathematics, a stochastic matrix (also termed probability matrix, transition matrix, substitution matrix, or Markov matrix) is a matrix used to describe the transitions of a Markov chain. It has found use in probability theory, statistics and linear algebra, as well as computer science. There are several different definitions and types of stochastic matrices;
In the same vein, one may define a stochastic vector as a vector whose elements consist of nonnegative real numbers which sum to 1. Thus, each row (or column) of a stochastic matrix is a probability vector, which are sometimes called stochastic vectors.
A common convention in English language mathematics literature is to use the right stochastic matrix; this article follows that convention.
Contents |
A stochastic matrix describes a Markov chain over a finite state space S.
If the probability of moving from to in one time step is , the stochastic matrix P is given by using as the row and column element, e.g.,
Since the probability of transitioning from state to some state must be 1, this matrix is a right stochastic matrix, so that
The probability of transitioning from to in two steps is then given by the element of the square of :
In general the probability transition of going from any state to another state in a finite Markov chain given by the matrix in k steps is given by .
An initial distribution is given as a row vector.
A stationary probability vector is defined as a vector that does not change under application of the transition matrix; that is, it is defined as a left eigenvector of the probability matrix, associated with eigenvalue 1:
The Perron–Frobenius theorem ensures that every stochastic matrix has such a vector, and that the largest absolute value of an eigenvalue is always 1. In general, there may be several such vectors. However, for a matrix with strictly positive entries, this vector is unique and can be computed by observing that for any we have the following limit,
where is the element of the row vector . This implies that the long-term probability of being in a state is independent of the initial state . That either of these two computations give one and the same stationary vector is a form of an ergodic theorem, which is generally true in a wide variety of dissipative dynamical systems: the system evolves, over time, to a stationary state. Intuitively, a stochastic matrix represents a Markov chain with no sink states, this implies that the application of the stochastic matrix to a probability distribution would redistribute the probability mass of the original distribution while preserving its total mass. If this process is applied repeatedly the distribution converges to a stationary distribution for the Markov chain.
Suppose you have a timer and a row of five adjacent boxes, with a cat in the first box and a mouse in the fifth box at time zero. The cat and the mouse both jump to a random adjacent box when the timer advances. E.g. if the cat is in the second box and the mouse in the fourth one, the probability is one fourth that the cat will be in the first box and the mouse in the fifth after the timer advances. If the cat is in the first box and the mouse in the fifth one, the probability is one that the cat will be in box two and the mouse will be in box four after the timer advances. The cat eats the mouse if both end up in the same box, at which time the game ends. The random variable K gives the number of time steps the mouse stays in the game.
The Markov chain that represents this game contains the following five states:
We use a stochastic matrix to represent the transition probabilities of this system,
As state 5 is an absorbing state the long-term average vector . Regardless of the initial conditions the cat will eventually catch the mouse.
As the game has an absorbing state 5 the distribution of time to absorption is discrete phase-type distributed. Suppose the system starts in state 2, represented by the vector . To simplify the calculations, state five can be ignored. Let
and remove state five to make a sub-stochastic matrix,
where is the identity matrix, and represents a column matrix of all ones. The expected time of the mouse's survival is given by
Higher order moments are given by